package com.shaoshaohuo.app.utils;

import com.shaoshaohuo.app.entity.PoiEntity;
import com.shaoshaohuo.app.view.citymenu.entity.Area;

/**
 * PoiEntity 工具类
 * @author osborn
 *
 */
public class PoiEntityUtils {

	public static PoiEntity convert(Area city, String fullAddress) {
		PoiEntity poi = new PoiEntity();
		if (city == null || city.getAreaId() == null) {
			return poi;
		}
        poi.setId(city.getAreaId());
		poi.setCityname(city.getName());
		poi.setAddress(fullAddress);
		poi.setTitle(fullAddress);
		if (city.getLat() != null) {
			poi.setLat(Double.parseDouble(city.getLat()));
		}
		if (city.getLng() != null) {
			poi.setLng(Double.parseDouble(city.getLng()));
		}
		return poi;
	}
	
}
